package com.haoshuang.zhouzhoubang.ui.adapter

import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemServiceEntryClickBinding
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


/**
 * 服务条目点击适配器*/
class ServiceEntryClickAdapter (data: MutableList<String>):
    BaseBindingQuickAdapter<String, ItemServiceEntryClickBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: String?) {
        var isCheck = false
        val binding = ItemServiceEntryClickBinding.bind(holder.itemView)
        binding.apply {
            tvServiceName.text = item
            ivServiceCircle.setOnClickListener {
                isCheck = !isCheck
                if (isCheck){
                    ivServiceCircle.setImageResource(R.mipmap.dz_ok)
                }else{
                    ivServiceCircle.setImageResource(R.mipmap.dz_wx)
                }
            }
        }
    }
}